// 定义爱心的点
function heart_points(steps,length) = [
    for(i = [0:steps])
        let(theta = i * 360 / steps) 
        let(r = length * (1-pow(sin(theta),1)))// 爱心的极坐标公式
        let(x = r * cos(theta))
        let(y = r * sin(theta))
        [x, y]
];

// 绘制实心爱心
module heart() {
    steps = 1000; // 精度，步数越多，形状越平滑
    length=10;
    points = heart_points(steps,length);
    polygon(points); // 使用polygon函数绘制实心形状
}

height=3;
// 调用模块
linear_extrude(height = height) // 沿Z轴拉伸
    heart();